<?php
require_once("class/class.db.jeegoon.php");
header("Content-Type: text/html; charset=utf-8");

$user = $_POST["LoginUser"];
$password = $_POST["LoginPassword"];

$salt = substr($password, 0, 2);
$encrypted_pswd = crypt($password, $salt);

$sh2 = new jeegoon();
$sql = "select * from member where Name='" . $user . "' and Password='" . $encrypted_pswd . "'";	
$count = $sh2->querycount($sql);

if($count ==1)
{	
  setcookie("LoginUser","seraph1",time()+3600);
  setcookie("EncryptPassword",$encrypted_pswd,time()+3600);
}
else
{
  setcookie("LoginUser","",time()-3600);
  setcookie("EncryptPassword","",time()-3600);
}

header( "Location:"  . $_POST["return"]) ;

?>
